From: Richard M. Stallman Date: Tue, 20 Mar 2007 16:23:47 +0000 (+0000) Subject: (compose-mail): Run switch-function after setting up the mail buffer. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~1442 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=87f6a8acc58263c861c0da22cb3ec47a3b7372c3;p=emacs.git (compose-mail): Run switch-function after setting up the mail buffer. (switch-to-completions): No error if search for \n\n fails. --- diff --git a/lisp/simple.el b/lisp/simple.el index 5bbfa317958..6871993d2b7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4726,9 +4726,16 @@ SEND-ACTIONS is a list of actions to call when the message is sent. Each action has the form (FUNCTION . ARGS)." (interactive (list nil nil nil current-prefix-arg)) - (let ((function (get mail-user-agent 'composefunc))) - (funcall function to subject other-headers continue - switch-function yank-action send-actions))) + (let ((function (get mail-user-agent 'composefunc)) + result-buffer) + (if switch-function + (save-window-excursion + (prog1 + (funcall function to subject other-headers continue + nil yank-action send-actions) + (funcall switch-function (current-buffer)))) + (funcall function to subject other-headers continue + nil yank-action send-actions)))) (defun compose-mail-other-window (&optional to subject other-headers continue yank-action send-actions) @@ -5165,7 +5172,7 @@ select the completion near point.\n\n")))))) (when window (select-window window) (goto-char (point-min)) - (search-forward "\n\n") + (search-forward "\n\n" nil t) (forward-line 1)))) ;;; Support keyboard commands to turn on various modifiers.